<%inherit file="/base.html"/>

<%def name="main_heading()">${c.district}</%def>

<%def name="toolbar()">
	${h.select_district(c.district.id)}
	${h.select_service(c.service)}
</%def>

<%def name="content()">
	<form style="clear:both;">
		${_('from')}:
		${c.begin_year_select}
		${c.begin_month_select}
		${_('to')}:
		${c.end_year_select}
		${c.end_month_select}
	</form>
	<table class="data-table">
		<thead>
			<tr>
				<th rowspan="2">${_('Year')}</th>
				<th rowspan="2">${_('Month')}</th>
				% for cell in c.thead[0]:
				<% caption, colspan = cell %>
				<th colspan="${colspan}">${caption}</th>
				% endfor
			</tr>
			% for row in c.thead[1:]:
			<tr>
				% for cell in row:
				<% caption, colspan = cell %>
				<th colspan="${colspan}">${caption}</th>
				% endfor
			</tr>
			% endfor
		</thead>
		% for record in c.records:
		<tr class="${'' if record.month else 'weighty-record'}">
			<td>${record.year if record.year else ''}</td>
			<td>${h.month_name(record.month) if record.month else _('Total')}</td>
			% for field in c.row(record):
			<td class="numeric">${field}</td>
			% endfor
		</tr>
		% endfor
	</table>
	<ul>
		<li><a href="${url.current(action='analysis', analytics='period', id=None)}">${_("Analysis for the period")}</a></li>
		<li><a href="${url.current(action='analysis', analytics='comparison', id=None)}">${_("Comparative analysis")}</a></li>
	</ul>
</%def>